<link rel="stylesheet" type="text/css" href="/shop/templates/template1/Css/search.css" />
<link rel="stylesheet" type="text/css" href="/shop/templates/template1/Css/nw.min.css" />
<link rel="stylesheet" type="text/css" href="/shop/templates/template1/Css/nw.newmall.css" />
<style>
    .nch-breadcrumb-layout{
        display: none !important;
    }
    #container{
        margin-top: 0;
    }
    #body{
        padding-top: 20px;
    }
</style>

<?php if(get_template_type() == 'index'){?>
<link href="/shop/templates/default/css/layout.css" rel="stylesheet" type="text/css">

<div id="container">
<?php
  $binfo = Model('brand')->find($_GET['brand']);
  if($_GET['op'] != 'show_place'){
  ?>
  <div>
    <img src="<?php echo $binfo[big_pic]?>" width='1090' height='340' alt="">

  </div>
  <?php }?>
<!-- <div id="bread_container">
    <a id="bread_prev" href="javascript:void(0);"></a>
    <div class="bread_container_con">
        <div class="search_crumb clearfix" style="width:1090px">
            <ul class="clearfix fl bread_ul">
                <li class="bread_first_item"><a href="index.php">首页</a></li>
            </ul>
                        
        <div class="right_search" id="J_bread_search">
            <form action="" method="get" target="_self">
                <input type="hidden" name="act" value="search">
                <span class="search_gt_1">&gt;</span>
                                        <input type="text" class="bread_search_input" name="keyword" id="J_bread_search_input" value="<?php echo $output['show_keyword'];?>">
                <input type="submit" value="" class="bread_search_img" id="J_right_search_submit">
            </form>
        </div>

        </div>
    </div>
    <a id="bread_next" href="javascript:void(0);"></a>
</div> -->

<div id="body">
<div id="search_result_wrap">
        <!--存在搜索结果显示的 页面内容 start-->

<div class="search_info" id="J_search_info"> </div>
<style>
    .filter_attrs .selected {
        font-weight: 600;
        line-height: 20px;
        color: #999;
        background-color: #FFF;
        display: inline-block;
        height: 20px;
        padding: 0px 0px 0px 5px;
        margin-right: 5px;
        border: 1px solid #D7D7D7;
        cursor: pointer;
    }
    .filter_attrs .selected em {
        line-height: 20px;
        color: #D93600;
        background-color: #FFF;
        vertical-align: top;
        display: inline-block;
        height: 20px;
        padding: 0px 2px;
        margin-left: 2px;
    }
    .filter_attrs .selected i {
        font-family: Verdana;
        line-height: 20px;
        color: #CCC;
        vertical-align: top;
        text-align: center;
        display: inline-block;
        width: 20px;
        height: 20px;
    }
    .filter_attrs .selected:hover {
        border-color: #D93600;
    }
    .filter_attrs .selected:hover i {
        color: #D93600;
    }
</style>

    
    
<style>
    .search_list_head .pagination{
        width: 120px;
        height: 32px;
        float: right;
        margin: 3px 0px 0 0;
    }
    .search_list_head .pagination li span{
        padding: 2px;
    }
    .search_list_head .pagination li{
        margin-left: 1px;
    }
</style>    
<div id="search_list_wrap">
    <div class="search_list_head_fiex">
        <div class="search_list_head" style="position: static; top: auto; width: 100%;">
            <div class="pagination"><?php echo $output['show_page1']; ?> </div>
            <div class="slh_label">排序:</div>
            <ul>
                <!-- <li class="selected">
                    <a class="down">默认</a>
                </li> -->
                <li <?php if(!$_GET['key']){?>class="selected"<?php }?>>
                    <a href="<?php echo dropParam(array('order', 'key'));?>"  title="<?php echo $lang['goods_class_index_default_sort'];?>" class="down"><?php echo $lang['goods_class_index_default'];?></a></li>
                <li <?php if($_GET['key'] == '1'){?>class="selected"<?php }?>><a class="down" href="<?php echo ($_GET['order'] == '2' && $_GET['key'] == '1') ? replaceParam(array('key' => '1', 'order' => '1')):replaceParam(array('key' => '1', 'order' => '2')); ?>" <?php if($_GET['key'] == '1'){?>class="<?php echo $_GET['order'] == 1 ? 'asc' : 'desc';?>"<?php }?> title="<?php echo ($_GET['order'] == '2' && $_GET['key'] == '1')?$lang['goods_class_index_sold_asc']:$lang['goods_class_index_sold_desc']; ?>"><?php echo $lang['goods_class_index_sold'];?><i></i></a></li>
                <li <?php if($_GET['key'] == '2'){?>class="selected"<?php }?>><a class="down" href="<?php echo ($_GET['order'] == '2' && $_GET['key'] == '2') ? replaceParam(array('key' => '2', 'order' => '1')):replaceParam(array('key' => '2', 'order' => '2')); ?>" <?php if($_GET['key'] == '2'){?>class="<?php echo $_GET['order'] == 1 ? 'asc' : 'desc';?>"<?php }?> title="<?php  echo ($_GET['order'] == '2' && $_GET['key'] == '2')?$lang['goods_class_index_click_asc']:$lang['goods_class_index_click_desc']; ?>"><?php echo $lang['goods_class_index_click']?><i></i></a></li>
                <li <?php if($_GET['key'] == '3'){?>class="selected"<?php }?>><a class="down" href="<?php echo ($_GET['order'] == '2' && $_GET['key'] == '3') ? replaceParam(array('key' => '3', 'order' => '1')):replaceParam(array('key' => '3', 'order' => '2')); ?>" <?php if($_GET['key'] == '3'){?>class="<?php echo $_GET['order'] == 1 ? 'asc' : 'desc';?>"<?php }?> title="<?php echo ($_GET['order'] == '2' && $_GET['key'] == '3')?$lang['goods_class_index_price_asc']:$lang['goods_class_index_price_desc']; ?>"><?php echo $lang['goods_class_index_price'];?><i></i></a></li>
            </ul>
            <!-- <div class="have_stock">
                <a href="">仅显示有货</a>
            </div> -->
            <!--头部分页-->
            <!-- <div class="head_pagebtn">
                <a class="dis prev">上一页
                </a>
                <a class="enable next" href="http://search.beeasy.com.cn/?filter=0-11-2&amp;search=%E6%B6%A6%E5%94%87%E8%86%8F&amp;bid=4#search_list_wrap">下一页
                </a>
            </div>
            <div class="head_pageInfo">
                <span style="color:#ed154b;margin-left: 8px;">1</span>/3页
            </div> -->

            <!-- <div class="head_pagecount">
                共<span>105</span>个商品
            </div> -->

</div>
</div>
                
<div class="products_wrap">
    <ul>
        <?php foreach($output['goods_list'] as $value){?>
    <li class="formall item">
    <?php
    ?>
      <div class="item_wrap clearfix" style="left: -14px;" nctype_goods=" <?php echo $value['goods_id'];?>" nctype_store="<?php echo $value['store_id'];?>">
        <div class="item_wrap_left" style="float: right;">
            <a class="cs_prev disabled"></a>
            <div class="cs_wrapper" style="overflow: hidden; position: relative;">
                <ul class="cs_list" style="position: absolute; height: 276px; top: 0px;">
                    <?php if(!empty($value['image'])) {?>
                      <?php $i=0;foreach ($value['image'] as $val) {$i++?>
                      <li <?php if($i==1) {?> class="selected"<?php }?>><img src="<?php echo thumb($val, 240,1);?>"/>
                      <span style="display: inline;"></span>
                      </li>
                      <?php }}?>
                </ul>
            </div>
            <a class="cs_next"></a>
        </div>
        <div class="item_wrap_right deal_item_wrap" style="float: left;">
            <div class="s_l_pic">
                <a href="<?php echo urlShop('goods','index',array('goods_id'=>$value['goods_id']));?>" target="_blank" title="<?php echo $value['goods_name'];?>">
                    <img src="<?php echo thumb($value, 240,1);?>" title="<?php echo $value['goods_name'];?>" alt="<?php echo $value['goods_name'];?>" width="255" height="255" />
                </a>
            </div>
            <div class="s_l_name">
                <a href="<?php echo urlShop('goods','index',array('goods_id'=>$value['goods_id']));?>" target="_blank" title="<?php echo $value['goods_jingle'];?>"><span class='title1'><?php echo $value['goods_name_highlight'];?></span><span class='title2'><?php echo $value['goods_jingle'];?></span></a>
            </div>
            <div class="s_l_view_bg">
                <div class="icon_wrap_bot clearfix"></div>
                <div class="search_list_price">
                    <!-- <label>¥</label> -->
                    <span><?php echo ncPriceFormatForList($value['goods_promotion_price']);?></span>
                    <del><?php echo ncPriceFormatForList($value['goods_marketprice']);?></del>
                    <div class="saleinfos">
                        </div>
                </div>
            </div>
            <div class="search_deal_buttom_bg clearfix">
                <div class="search_pl"><?php echo $value['evaluation_count'];?>篇评价|</div>
                <div class="rating"><div style="width:<?php echo $value['evaluation_good_star']*20?>%" class="value"></div></div>
            </div>
            <div class="search_list_button">
                <a href="javascript:;" target="_blank" class="track_click btn_addcart"  nctype="add_cart" data-param="{goods_id:<?php echo $value['goods_id'];?>}" title="加入购物车">
                </a>
                <a href="javascript:;" class="btn_fav" pid="1038039" title="收藏商品"></a>
            </div>
          
        </div>
      </div>
    </li>
    <?php }?>
    <div class="clear"></div>
    <script>
        $(function(){
            $('.products_wrap li').each(function(){
                $(this).hover(function(){
                    $(this).addClass('hover');
                    $(this).find('.item_wrap_left').show();
                    // $(this).find('.item_wrap').css('left');
                },function(){
                    $(this).removeClass('hover');
                    $(this).find('.item_wrap_left').hide();
                })
            })
        })
    </script>
    <script>
        $(function(){
            // 加入购物车
            $('a[nctype="addcart_submit"]').click(function(){
                var goods_id = $(this).attr('data-param');
                var src = $(this).closest('.item').find('.s_l_pic img').attr('src');
                add_to_cart_animate(this,src);
                addcart(goods_id, 1,'addcart_callback');
            });
            $('.products_wrap li').each(function(){
                $(this).hover(function(){
                    $(this).addClass('hover');
                    $(this).find('.item_wrap_left').show();
                    // $(this).find('.item_wrap').css('left');
                },function(){
                    $(this).removeClass('hover');
                    $(this).find('.item_wrap_left').hide();
                })
            });


            $(document).on('click','.cs_next,.cs_prev',function(){
                if($(this).hasClass('disabled')){
                    return false;
                }
                var list = $(this).parent().find('.cs_list');
                if(list.find('li').length <= 3){
                    return false;
                }
                var top = parseInt(list.css('top'));
                if($(this).hasClass('cs_next')){
                    list.animate({
                        top : '-=70'
                    })
                    if((list.find('li').length - 3) * -70 < top){
                        $(this).addClass('disabled');
                        $(this).parent().find('.cs_prev').removeClass('disabled');
                    }
                }
                else{
                    list.animate({
                        top : '+=70'
                    })
                    if((list.find('li').length - 3) * -70 == -70){
                        $(this).addClass('disabled');
                        $(this).parent().find('.cs_next').removeClass('disabled');
                    }
                }
                
                return false;
            });

            $('.cs_list').each(function(){
                if($(this).find('li').length <= 3){
                    $(this).parent().next().addClass('disabled');
                    
                }
            })

            $(document).on('mouseenter','.cs_list li',function(){
                $(this).addClass('active').siblings().removeClass('active');
                $(this).closest('.item').find('.s_l_pic img').attr('src',$(this).find('img').attr('src'))
            })
        })

        /* 加入购物车后的效果函数 */
        function addcart_callback(data){
              // layer.msg('加入购物车成功',{
              //     btn : ['现在去结算','继续购物'],
              //     btn1 : function(){
              //       location.href = '/shop/?act=cart';
              //     },
              //     btn2 : function(){
              //       layer.closeAll();
              //     }
              // });
            // $('#bold_num').html(data.num);
         //    $('#bold_mly').html(price_format(data.amount));
         //    $('.ncs-cart-popup').fadeIn('fast');
        }
    </script>
</div>
<div class="page-nav-wrapper">
    <div class="pagination"> <?php echo $output['show_page']; ?> </div>
</div>

</div>
<style>
    #guesslike_div .title{
        display: none !important;
    }
</style>
    <div id="browse_history" class="browse_history_wide" style="display: block;">
    <div class="title">
        您最近查看的商品<em>RECENTLY VIEWD ITEMS</em>
    </div>
    <div class="bh_content">
        <!--浏览记录-->
        <!-- <div class="browse_list_wrap fl">
            <h2 class="browse_tit">查看记录</h2>
            <div class="browse_list"><p style="text-align:center;margin-top: 120px;">你最近没有浏览过聚美商品，<br>快去逛逛吧~</p></div>
        </div> -->
        <!-- <div class="browse_Recommend fr" style="float:none !important;"> -->
        <div id="guesslike_div"></div>
        <!-- </div> -->
    </div>
</div>

<script src="http://fm.p0y.cn/j/adv.js"></script>
<script>
    $(function(){
        // var screen_wide = document.documentElement.clientWidth > 1200 ? true : false ;
        // if(screen_wide){
        //     $('#browse_history').addClass('browse_history_wide');
        // }
        //猜你喜欢
        $('#guesslike_div').load('<?php echo urlShop('search', 'get_guesslike', array()); ?>', function(){
            $(this).show();
        });
    });
</script>
    
</div>
</div>
</div>
<?php }?>